//package com.study.config;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.PropertySource;
//
//import javax.sql.DataSource;
//
//
///**
// * @ClassName Jdbcconfig
// * @Description TODO
// * @Author ThinkPad
// * @Date 2020/11/9 15:35
// * @Version 1.0
// **/
////@PropertySource("classpath:application.yml")
//@Configuration
//public class Jdbcconfig  {
//
////    @Value("${jdbc.driverClassName}")
////    private String driverClassName;
////    @Value("${jdbc.url}")
////    private String url;
////    @Value("${jdbc.username}")
////    private String username;
////    @Value("${jdbc.password}")
////    private String password;
////
////    public String getDriverClassName() {
////        return driverClassName;
////    }
////
////    public void setDriverClassName(String driverClassName) {
////        this.driverClassName = driverClassName;
////    }
////
////    public String getUrl() {
////        return url;
////    }
////
////    public void setUrl(String url) {
////        this.url = url;
////    }
////
////    public String getUsername() {
////        return username;
////    }
////
////    public void setUsername(String username) {
////        this.username = username;
////    }
////
////    public String getPassword() {
////        return password;
////    }
////
////    public void setPassword(String password) {
////        this.password = password;
////    }
//
////    @Bean
////    public DataSource initDataSource(){
////        DruidDataSource dataSource = new DruidDataSource();
////        dataSource.setDriverClassName(driverClassName);
////        dataSource.setUrl(url);
////        dataSource.setUsername(username);
////        dataSource.setPassword(password);
////        return dataSource;
////    }
//    //方法一
////    @Bean
////    public DataSource initDataSource(JdbcProties jdbc){
////        DruidDataSource dataSource = new DruidDataSource();
////        dataSource.setDriverClassName(jdbc.getDriverClassName());
////        dataSource.setUrl(jdbc.getUrl());
////        dataSource.setUsername(jdbc.getUsername());
////        dataSource.setPassword(jdbc.getPassword());
////        return dataSource;
////    }
//
//    //方法二
//    @Bean
//    @ConfigurationProperties(prefix="jdbc")
//    public DataSource initDataSource(){
//        return new DruidDataSource();
//    }
//}
